import request from '../../utils/request.js'
export default {
	state: {
		indexInit:{}
	},
	mutations: {
		GETINDEXDATA(state,indexInit){
			state.indexInit=indexInit
		}
	},
	actions: {
		async getIndexData({commit}) {
			let result=await request('/indexData')
			if(result.code===200){
				commit('GETINDEXDATA',result.indexData)
			}
		}
	},
	getters: {
		kingKongList(state){
			return state.indexInit.kingKongModule?state.indexInit.kingKongModule.kingKongList:[]
		},
		policyDescList(state){
			return state.indexInit.policyDescList?state.indexInit.policyDescList:[]
		},
		categoryModule(state){
			return state.indexInit.categoryModule?state.indexInit.categoryModule:[]
		}
		
	}
}
